From: Keir Fraser Date: Mon, 4 Feb 2008 13:51:17 +0000 (+0000) Subject: x86 shadow: Cleanup for early-unshadow code. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14341^2~1 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=47cffd5fe1ad310ea1b703faa4c0999f1cc98153;p=xen.git x86 shadow: Cleanup for early-unshadow code. The unhooking of toplevel shadow entries has been removed; the rest of the early-unshadow code needs to reflect that. Signed-off-by: Tim Deegan --- diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c index c9f16bf4bb..f12a97fbde 100644 --- a/xen/arch/x86/mm/shadow/multi.c +++ b/xen/arch/x86/mm/shadow/multi.c @@ -2588,19 +2588,15 @@ sh_map_and_validate_gl1e(struct vcpu *v, mfn_t gl1mfn, * easier. */ /* Look to see if this is the second emulated write in a row to this - * page, and unshadow/unhook if it is */ + * page, and unshadow if it is */ static inline void check_for_early_unshadow(struct vcpu *v, mfn_t gmfn) { #if SHADOW_OPTIMIZATIONS & SHOPT_EARLY_UNSHADOW if ( v->arch.paging.shadow.last_emulated_mfn == mfn_x(gmfn) && sh_mfn_is_a_page_table(gmfn) ) { - u32 flags = mfn_to_page(gmfn)->shadow_flags; - if ( !(flags & (SHF_L2_32|SHF_L2_PAE|SHF_L2H_PAE|SHF_L4_64)) ) - { - perfc_incr(shadow_early_unshadow); - sh_remove_shadows(v, gmfn, 1, 0 /* Fast, can fail to unshadow */ ); - } + perfc_incr(shadow_early_unshadow); + sh_remove_shadows(v, gmfn, 1, 0 /* Fast, can fail to unshadow */ ); } v->arch.paging.shadow.last_emulated_mfn = mfn_x(gmfn); #endif @@ -3487,12 +3483,6 @@ sh_set_toplevel_shadow(struct vcpu *v, } ASSERT(mfn_valid(smfn)); -#if SHADOW_OPTIMIZATIONS & SHOPT_EARLY_UNSHADOW - /* Once again OK to unhook entries from this table if we see fork/exit */ - ASSERT(sh_mfn_is_a_page_table(gmfn)); - mfn_to_page(gmfn)->shadow_flags &= ~SHF_unhooked_mappings; -#endif - /* Pin the shadow and put it (back) on the list of pinned shadows */ if ( sh_pin(v, smfn) == 0 ) { diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h index 72a41d9a74..82d1e9e9b8 100644 --- a/xen/arch/x86/mm/shadow/private.h +++ b/xen/arch/x86/mm/shadow/private.h @@ -334,9 +334,6 @@ static inline int sh_type_is_pinnable(struct vcpu *v, unsigned int t) #define SHF_PAE (SHF_L1_PAE|SHF_FL1_PAE|SHF_L2_PAE|SHF_L2H_PAE) #define SHF_64 (SHF_L1_64|SHF_FL1_64|SHF_L2_64|SHF_L2H_64|SHF_L3_64|SHF_L4_64) -/* Used for hysteresis when automatically unhooking mappings on fork/exit */ -#define SHF_unhooked_mappings (1u<<31) - /****************************************************************************** * Various function declarations